package com.xbjtech.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import lombok.Data;

@Table(name = "seller")
@Data
public class Seller {
	
	@Id
    private Integer id;

	@NotBlank(message = "商家名称不能为空")
    private String name;

	@NotBlank(message = "联系电话不能为空")
    private String mobile;

	@NotBlank(message = "联系人不能为空")
    private String linkName;
	
	public static void main(String[] args) {
		String datastr = "2019年03月04日";
		SimpleDateFormat df = new SimpleDateFormat("yyyy年MM月dd日");
		try {
			Date date = df.parse(datastr);
			Calendar calendar = Calendar.getInstance();
			calendar.setTime(date);
			int year = calendar.get(Calendar.YEAR); // 这个就是年  值：2019
			int month = calendar.get(Calendar.MONTH); // 这个就是年  值：3
			int day = calendar.get(Calendar.DAY_OF_MONTH); // 这个就是年  值：4
			
		} catch (ParseException e) {
			System.out.println("日期选择格式有问题");
			e.printStackTrace();
		}
		
		Map<String, Object> params = new HashMap<>();
		Set<Entry<String, Object>> entrySet = params.entrySet();
		Iterator<Entry<String, Object>> iterator = entrySet.iterator();
		while (iterator.hasNext()) {
			Entry<String, Object> entry = iterator.next();
			System.out.println("key:" + entry.getKey() + "===value:" + entry.getValue());
		}
		
		
		
	}
	
}